package com.mkvld.appietijdenv2.data;

import java.util.Calendar;
import java.util.Locale;


public class Utils {

	public static Locale locale = new Locale("nl", "NL");
	public static String timeToString(double time) {
		if (time == -1)
			return "";
		
		return String.format(locale, "%02d:%02d", (int)time, (int)((time % 1) * 60));
	}
	
	public static int getCurrentWeek() {
		return Calendar.getInstance(locale).get(Calendar.WEEK_OF_YEAR) - 1;
	}
	
	public static int getCurrentPeriod() {
		return (Calendar.getInstance(locale).get(Calendar.WEEK_OF_YEAR) - 1) / 4;
	}
	
	public static int getCurrentYear() {
		return Calendar.getInstance(locale).get(Calendar.YEAR);
	}
}
